#include <stdio.h>
#include <algorithm>

#define MAX_SPROCKETS 10

int main()
{
    int num_front, num_rear;
    while (scanf("%d %d", &num_front, &num_rear) == 2 && num_front > 0)
    {
        int front[MAX_SPROCKETS], rear[MAX_SPROCKETS];
        double ratio[MAX_SPROCKETS*MAX_SPROCKETS], max_spread = 0;
        int i, j, k = 0;

        for (i = 0; i < num_front; i++)
            scanf("%d", &front[i]);
        for (i = 0; i < num_rear; i++)
            scanf("%d", &rear[i]);

        for (i = 0; i < num_front; i++)
            for (j = 0; j < num_rear; j++)
                ratio[k++] = (double)rear[j] / (double)front[i];

        std::sort(ratio + 0, ratio + k);
        for (i = 1; i < k; i++)
        {
            double spread = ratio[i] / ratio[i-1];
            if (spread > max_spread)
                max_spread = spread;
        }
        printf("%.2lf\n", max_spread);
    }
    return 0;
}